
/* ==================================================================== */
/* This File Exclaims All the Double Link Node/List Operation Functions */
/*                   And Also The Structs and MACROs                    */
/* ==================================================================== */
#ifndef _D_LINK_LIST_H
#define _D_LINK_LIST_H

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

typedef struct _DOUBLE_LINK_NODE
{
	int 	data;
	struct _DOUBLE_LINK_NODE *p_prev;	
	struct _DOUBLE_LINK_NODE *p_next;
}DL_NODE;

typedef struct _DOUBLE_LINK_LIST
{
	int		 node_count;
	DL_NODE *p_head;
	DL_NODE *p_tail;	
}DL_LIST;

#define TOLERANCE 5



//followed are double link node/list operation functions
extern int dl_test_main(DL_LIST *p_list_test);
extern DL_NODE *create_dl_node(int data);
extern DL_LIST *create_an_empty_dl_list(void);
extern int insert_dl_node_to_head(DL_LIST *p_list, int data);
extern int insert_dl_node_to_tail(DL_LIST *p_list, int data);
extern int delete_dl_node(DL_LIST *p_list, int data);
extern DL_NODE *find_dl_node(DL_LIST *p_list, int data);
extern int print_dl_node(DL_LIST *p_list);
extern int change_dl_node_data(DL_LIST *p_list,int old_data, int new_data);

#endif
